Skip to content

Feature/Object Centric Event Log tab - #428

Open
alkalinan wants to merge 11 commits into
mainfrom
feature/call-graph-tools
Open

alkalinan wants to merge 11 commits into
mainfrom
feature/call-graph-tools

Conversation

@alkalinan

Copy link
Copy Markdown

Add an "OCEL" inspector tab: call graph of tool calls from OpenTelemetry spans

An object-centric process-mining view of the MCP server, built from the OpenTelemetry spans of tool calls. Events are tool calls; the objects are the tool, the session and the client.

What it adds

  • Local spans mode: keeps spans in memory in the image, no export (toggle "Keep spans (no export)").
  • OCEL model (MCPOcelLog, MCPOcelFlowGraph, MCPOcelEdge): event log and a directly-follows graph per object type.
  • Inspector tab "OCEL" in the new package MCP-OpenTelemetry-UI (group Telemetry UI, loaded only with OpenTelemetry): tables plus a Roassal graph.
  • Interactive graph: drag, hover highlight, selection shared with the tables.
  • Auto-refresh toggle.
  • Dashboard icons on each tool box.
  • Arrow thickness follows the number of cases (1 px to 9 px, capped at 50+), with a legend.

Visuals

ocel-arrow-widths-session ocel-icons ocel-legend-tool

Notes

  • Roassal is not declared in the baseline (it ships with Pharo 13.1).
  • Two pre-existing test failures in MCP-OpenTelemetry-Tests are unrelated: the client-name test and the one depending on MCPEvaluateTestProbe (MCP-Tests not loaded).

@alkalinan alkalinan changed the title Feature/call graph tools Feature/Object Centric Event Log tab Nov 24, 2026

@Gabriel-Darbord Gabriel-Darbord left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed with both branches loaded in a fresh Pharo 14 image, driving the real server; MCP-OpenTelemetry-Tests and MCP-UI-Tests pass. The OCEL tab works in the inspector.

Where it belongs

We don't think this should be merged into MCP as it is. Whatever we merge, we maintain, and most of this PR is an analysis of MCP's spans, not something MCP needs to do its job:

  • an in-memory span store wired into the OpenTelemetry backend;
  • an object-centric event log and directly-follows graphs (process mining);
  • a span JSON format plus OCEL 2.0 import and export;
  • a Roassal UI.

The tab is already added by an extension method in its own package, so moving it out costs little. Proposed split:

  • In MCP, as its own small PR with tests: a generic hook, spans handed to extra span processors that survive MCP's provider rebuilds, and spans made even when nothing is exported. It must not name what uses it.
  • In its own repository: the OCEL model, the file formats and the Roassal UI, depending on MCP's Telemetry group. Its baseline declares Roassal and the Pharo versions it supports.

The hook is the part that needs the most care today. Ticking "Keep spans":

  • switches the server to the OpenTelemetry backend;
  • when nothing is exported, replaces the image's global tracer, meter and logger providers, which the comment of reconfigure:with: says may be the user's;
  • does so for every server in the image, and stays on in a saved image.

Screen checks (head 15e2418)

  • The window is still "Unnamed Window" when the presenter is opened on its own: it has no title, while MCPObservabilityPresenter has 'MCP Observability'. In the inspector the tab reads "OCEL".
  • The toolbar overflows: at 700 px wide (the size of the screenshots above), Refresh, Clear, Export and Import are off-screen. In the inspector each table shows about two rows.
  • "Object: tool" draws almost no arrows by construction: a tool's calls only follow each other, so the graph is boxes labelled "again xN" plus one arrow per dispatched call. "Object: session" is the useful view.
  • Export and Import are broken on Pharo 10 and 11: CI warns that StSaveFilePresenter, StOpenFilePresenter and StCustomExtensionsFilter are undeclared there. CI is green only because no test opens the presenter.
  • "Keep spans (no export)" misleads in an image that exports spans: they are still exported, as the settings say.
  • "OCEL" is jargon for a tab name, and the code calls the view a call graph (MCPCallGraphPresenter, inspectionCallGraph:).
  • The description no longer matches the branch: it doesn't mention Export/Import, OCEL 2.0 or the layout menu.

@Gabriel-Darbord Gabriel-Darbord left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Either:

  • Argue how this belongs to the MCP project
  • Update this PR to implement the hook
  • Close and open a new PR with the hook

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants